<template>
  <h1>Login 登录页</h1>

  <button @click="loginBtn">登录按钮</button>
  <button @click="router.push('/home')">直接跳主页</button>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";

//  相对于 this.$router
const router = useRouter();

const loginBtn = () => {
  alert("登录成功，跳转到主页");
  router.push("/home");
};
</script>


